package com.qd.common.panda.domain.entity.plate;

import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 车辆信息
 * 车辆和人员关系
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class UserPlateDTO {
    @NotBlank(message = "关系ID不能为空", groups = {UpdateGroup.class})
    @Size(max = 50, message = "关系ID长度不能超过{max}位", groups = {UpdateGroup.class})
    @JsonProperty("rid")
    private String rId;
    /**
     * 车牌
     */
    @NotBlank(message = "车牌不能为空", groups = DefaultGroup.class)
    @Size(max = 8, message = "车牌长度不能超过{max}位", groups = DefaultGroup.class)
    private String plateNumber;
    /**
     * 车牌颜色
     */
    private Integer vehicleColor;
    /**
     * 用户唯一标识
     */
    @Size(max = 50, message = "用户唯一标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 充电是否自动确认
     */
    @Size(max = 50, message = "充电是否自动确认长度不能超过{max}位", groups = DefaultGroup.class)
    private String autoConfirmCharge;

    public void freeData() {
        this.rId = null;
        this.plateNumber = null;
        this.userId = null;
        this.autoConfirmCharge = null;
        this.vehicleColor = null;
    }
}
